home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / NEWSOFT / AUGUST / ARCWEB / !ArcWeb / h / requester
Text File  |  1997-06-15  |  12KB  |  313 lines

  1. /*
  2.  * ArcWeb
  3.  *
  4.  * Copyright (C) Stewart Brodie, 1994, 1995, 1996, 1997
  5.  *
  6.  * This product is supplied under the terms laid down in the `Terms' file.
  7.  *
  8.  * This file may be distributed freely with any ArcWeb related software,
  9.  * provided it meets with the definition of 'free' in the 'Terms' file.
  10.  *
  11.  * This file: requester.h
  12.  *
  13.  *   A WIMP-library-independent interface definition.  All structures are
  14.  *   defined in terms of basic types.
  15.  *
  16.  * Last changes: for ArcWeb 1.77 - new flags.
  17.  *
  18.  */
  19. #ifndef _requester_h_included
  20. #define _requester_h_included
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24.  
  25. #define arcweb_MAXURL           (200)
  26.  
  27.  
  28. #define msg_Arcweb__base        (0x4A240)
  29. #define msg_Arcweb__last    (msg_Arcweb__base + 0x3f)
  30. #define swi_Arcweb__base        (msg_Arcweb__base)
  31. #define err_Arcweb__base        (0x80D200)
  32.  
  33. typedef enum {
  34.  
  35.         Message_ArcwebFetchRequest    = (msg_Arcweb__base +  0),
  36.         Message_ArcwebFetchDone       = (msg_Arcweb__base +  1),
  37.         Message_ArcwebRenderRequest   = (msg_Arcweb__base +  2),
  38.         Message_ArcwebRenderDone      = (msg_Arcweb__base +  3),
  39.         Message_ArcwebPostRequest     = (msg_Arcweb__base +  4),
  40.         Message_ArcwebPostDone        = (msg_Arcweb__base +  5),
  41.         Message_ArcwebEMailRequest    = (msg_Arcweb__base +  6),
  42.         Message_ArcwebEMailDone       = (msg_Arcweb__base +  7),
  43.  
  44.         Message_ArcwebImageSize       = (msg_Arcweb__base + 16),
  45.         Message_ArcwebImageComplete   = (msg_Arcweb__base + 17),
  46.         Message_ArcwebXferControl     = (msg_Arcweb__base + 18),
  47.         Message_ArcwebXferControlAck  = (msg_Arcweb__base + 19),
  48.  
  49.         Message_ArcwebQuit            = (msg_Arcweb__base + 32),
  50.         Message_ArcwebExpire          = (msg_Arcweb__base + 33),
  51.         Message_ArcwebAbortRequest    = (msg_Arcweb__base + 34),
  52.         Message_ArcwebTransferStatus  = (msg_Arcweb__base + 35),
  53.         Message_ArcwebConfigure       = (msg_Arcweb__base + 36),
  54.         Message_ArcwebExternalLaunch  = (msg_Arcweb__base + 37),
  55.         Message_ArcwebLaunchDone      = (msg_Arcweb__base + 38),
  56.         Message_ArcwebWebBrowser      = (msg_Arcweb__base + 39),
  57.         Message_ArcwebColourSelected  = (msg_Arcweb__base + 40),
  58.         Message_ArcwebPermanentMove   = (msg_Arcweb__base + 41),
  59.  
  60.         Message_IntertalkRequest      = (0x4AF80)
  61.  
  62. } arcweb_msgid;
  63.  
  64.  
  65. /* Use these constants in the flag words in the messages below */
  66.  
  67. #define arcweb_FLAGS_error              0x80000000
  68. #define arcweb_FLAGS_typeknown          0x40000000
  69. #define arcweb_FLAGS_inhibit_render     0x20000000
  70. #define arcweb_FLAGS_want_symlink       0x10000000
  71. #define arcweb_FLAGS_url_changed        0x08000000
  72. #define arcweb_FLAGS_close_previous     0x04000000
  73. #define arcweb_FLAGS_image_fetch        0x02000000
  74. #define arcweb_FLAGS_error_handled      0x01000000
  75. #define arcweb_FLAGS_inhibit_display    0x00800000
  76. #define arcweb_FLAGS_extended_url       0x00400000
  77. #define arcweb_FLAGS_email_complete     0x00200000
  78. #define arcweb_FLAGS_reload        0x00100000
  79. #define arcweb_FLAGS_load_to_disc    0x00080000
  80. #define arcweb_FLAGS_forcing_reload    0x00040000
  81. #define arcweb_FLAGS_reserved_mask      0x00020000
  82. #define arcweb_FLAGS_extended_type      0x00010000
  83. #define arcweb_FLAGS_typemask           0x0001ffff
  84. #define arcweb_FLAGS_stream        0x00004000
  85. #define arcweb_FLAGS_rnfr        0x00002000
  86. #define arcweb_FLAGS_dele        0x00001000
  87. #define arcweb_FLAGS_rmdir        0x00000800
  88. #define arcweb_FLAGS_mkdir        0x00000400
  89. #define arcweb_FLAGS_put        0x00000200
  90. #define arcweb_FLAGS_forcing_images    0x00000100
  91. #define arcweb_FLAGS_referer_available    0x00000080
  92. #define arcweb_FLAGS_xfer_control       0x00000020
  93. #define arcweb_FLAGS_images_disabled    0x00000010
  94. #define arcweb_FLAGS_post_was_put       0x00000008
  95. #define arcweb_FLAGS_fast_images    0x00000004
  96. #define arcweb_FLAGS_local_launch    0x00000002
  97. #define arcweb_FLAGS_document_fetch    0x00000000
  98.  
  99.  
  100. #define arcweb_XFER_xmit_running        0x00000001
  101. #define arcweb_XFER_recv_running        0x00000002
  102. #define arcweb_XFER_xmit_complete       0x00000004
  103. #define arcweb_XFER_recv_complete       0x00000008
  104. #define arcweb_XFER_misc_running        0x00000010
  105. #define arcweb_XFER_reserved            0xffffffe0
  106.  
  107.  
  108. /* Flag bit meanings:
  109.  *
  110.  *  Responses only:
  111.  *      bits 0 to 15    : RISC OS/ArcWeb filetype indicator
  112.  *      bit 16          : if set, type is arcweb_TYPES_*, else RISC OS type
  113.  *
  114.  *  Requests only:
  115.  *      bit  1          : the previous page was a local: URL
  116.  *      bit  2          : if set, 'fast images' are being used - not implemented yet
  117.  *      bit  3          : if set, the POST request should be sent as a PUT instead
  118.  *      bit  4          : if set, user has disabled image fetching
  119.  *      bit  5          : if set, control transfer protocol is available
  120.  *    bit  6        Reserved - must be zero
  121.  *    bit  7        Internal use only - must be zero for non-ArcWeb tasks
  122.  *    bit  8        If set, user has forced image fetching for this fetch
  123.  *    bit  9        If set, user requested a PUT operation
  124.  *    bit  10        If set, user requested the URI be created as a directory
  125.  *    bit  11        If set, user requested the directory URI be deleted
  126.  *    bit  12        If set, user requested deletion of URI
  127.  *    bit  13        If set, user requested rename of URI
  128.  *      bit  14        Reserved - must be zero (or you'll be sorry)
  129.  *
  130.  *  Both:
  131.  *
  132.  *      bits 17 and 18  : reserved (must be preserved in replies)
  133.  *      bit 19          : if set, user has requested a 'load to disc'
  134.  *      bit 20          : if set, this is a reload, so flush any cache
  135.  *      bit 21          : if set, the e-mail message is complete
  136.  *      bit 22          : if set, this is an extended URL
  137.  *      bit 23          : if set, ArcWeb will not display the results of the render
  138.  *      bit 24          : if set, ArcWeb wont raise any error to user
  139.  *      bit 25          : if set, this is an inline image fetch, not a page fetch
  140.  *      bit 26          : if set, the previous ArcWeb window should be closed
  141.  *      bit 27          : if set, URL has been changed (+ is in URL file)
  142.  *      bit 28          : if set, request use of symbolic link in host filesystem
  143.  *      bit 29          : if set, (in FetchDone), ArcWeb will not render it
  144.  *      bit 30          : if set, bits 0-16 are valid, else they are invalid
  145.  *      bit 31          : if set, the buffer contains an error message
  146.  *
  147.  */
  148.  
  149. typedef struct {
  150.         struct arcweb_msghdr {    /* message block header. */
  151.           int size;               /* 20<=size<=256, multiple of 4 */
  152.           int task;               /* task handle of sender (filled in by wimp) */
  153.           int my_ref;             /* unique ref number (filled in by wimp) */
  154.           int your_ref;           /* (0==>none) if non-zero, acknowledge */
  155.           arcweb_msgid action;    /* message action code */
  156.         } hdr;
  157.         void           *handle;         /* MUST be preserved */
  158.         int             flags;          /* See above */
  159.         union {
  160.                 int  _arcweb_words[57]; /* Ensure the right size */
  161.                 char _arcweb_data[228]; /* a char version        */
  162.  
  163.                 struct {
  164.                         int     localfile;  /* *RISC OS* file handle */
  165.                         union {
  166.                                 int     url_file;            /* if bit 22 set */
  167.                                 char    URL[arcweb_MAXURL];  /* if bit 22 clr */
  168.                         } url;
  169.                 } fetch_request;
  170.  
  171.                 union {
  172.                         struct {
  173.                                 int     use_given_expiry;
  174.                                 int     use_default_expiry;
  175.                                 char    date[8]; /* to stop Cv5 warnings */
  176.                                 int    response_code;
  177.                                 char    mime_type[208]; /* MUST start "MIME:" */
  178.                         } expiry;
  179.                         char    error[228];
  180.                 } fetch_done;
  181.  
  182.                struct {
  183.                         int     localfile;
  184.                         int     formfile;
  185.                         union {
  186.                                 int     url_file;            /* if bit 22 set */
  187.                                 char    URL[arcweb_MAXURL];  /* if bit 22 clr */
  188.                         } url;
  189.                 } post_request;
  190.  
  191.                 struct {
  192.                         int     localsrc;
  193.                         int     localtmp;
  194.                         int     localdiag;
  195.                         int     locallink;
  196.                         int     size_in_msg;
  197.                         char    fileheader[228-5*sizeof(int)];
  198.                 } render_request;
  199.  
  200.                 union {
  201.                         struct {
  202.                                 int x_pix;
  203.                                 int y_pix;
  204.                         } size;
  205.                         char    error[228];
  206.                 } render_done;
  207.  
  208.                 struct {
  209.                         int     formfile;
  210.                 } email_request;
  211.  
  212.                 struct {
  213.                         char    error[228]; /* Do I want this? */
  214.                 } email_done;
  215.  
  216.                 struct {
  217.                         union {
  218.                                 int  url_file;           /* if bit 22 set   */
  219.                                 char URL[arcweb_MAXURL]; /* if bit 22 clear */
  220.                         } url;
  221.                 } expire;
  222.  
  223.                  union {
  224.                         struct {
  225.                                 int     use_given_expiry;
  226.                                 int     use_default_expiry;
  227.                                 char    date[8]; /* to stop Cv5 warnings */
  228.                                 int    response_code;
  229.                                 char    mime_type[208]; /* MUST start "MIME:" */
  230.                         } expiry;
  231.                         char    error[228];
  232.                 } post_done;
  233.  
  234.                 struct {
  235.                         int     flags;
  236.                         int     transmit_total;
  237.                         int     transmit_sofar;
  238.                         int     receive_total;
  239.                         int     receive_sofar;
  240.                         char    message[208];
  241.                 } status_report;
  242.  
  243.                 struct {
  244.                         char    reason[228];
  245.                 } abort_request;
  246.  
  247.                 struct {
  248.                         int     renderer_handle;
  249.                         int     x_os_units;
  250.                         int     y_os_units;
  251.                 } image_size;
  252.  
  253.                 struct {
  254.                         int     renderer_handle;
  255.                 } image_complete;
  256.  
  257.                 struct {
  258.                     char    application[228];
  259.                 } configure;
  260.  
  261.                 struct {
  262.                         union {
  263.                                 int  url_file;           /* if bit 22 set   */
  264.                                 char URL[arcweb_MAXURL]; /* if bit 22 clear */
  265.                         } url;
  266.                 } launch_request;
  267.  
  268.                 struct {
  269.                         char    error[228];
  270.                 } launch_done;
  271.  
  272.                 struct {
  273.                         int     localfile;  /* *RISC OS* file handle */
  274.                         union {
  275.                                 int     url_file;            /* if bit 22 set */
  276.                                 char    URL[arcweb_MAXURL];  /* if bit 22 clr */
  277.                         } url;
  278.                 } xfer_request;
  279.  
  280.                 struct {
  281.                         char    error[228];
  282.                 } xfer_request_ack;
  283.                 
  284.                 struct {
  285.                         char     browser[228];
  286.                 } web_browser;
  287.  
  288.         struct {
  289.                 int    background;
  290.                 int    normal;
  291.                 int    link;
  292.                 int    vlink;
  293.                 int    alink;
  294.                 int    no_images;
  295.         } colour_selection;
  296.         
  297.         struct {
  298.                 /* NOTE: These pointers are possibly in app w/s */
  299.                 /* Must use Wimp_TransferBlock to get them */
  300.                 const char     *from;
  301.                 int        fromsize;
  302.                 const char    *to;
  303.                 int        tosize;
  304.         } permanent_move;
  305.  
  306.         } data;
  307. } arcweb_msg; /* use as a wimp_msgstr */
  308.  
  309. #ifdef __cplusplus
  310. }
  311. #endif
  312. #endif
  313.